using System;
using System.Collections.Generic;

public class CircularQuene<T> : List<T>
{
	public CircularQuene(int maxCount)
	{
		this.count = maxCount;
	}

	public new void Add(T variable)
	{
		base.Add(variable);
		if (base.Count > this.count)
		{
			base.RemoveAt(0);
		}
	}

	public int MaxCount
	{
		get
		{
			return this.count;
		}
		set
		{
			this.count = value;
		}
	}

	public T Pop()
	{
		T result = base[base.Count - 1];
		base.RemoveAt(base.Count - 1);
		return result;
	}

	private int count;
}
